package com.xw.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author y
 * @since 2021-09-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("tbl_reserve_setting")
public class ReserveSetting extends Model<ReserveSetting> {

    private static final long serialVersionUID = -1682074488247002095L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 可预约日期
     */
    private String reserveTime;

    /**
     * 可预约人数
     */
    private Integer reserveNumber;


    /**
     * 已预约人数
     */
    private Integer yetReserveNumber;

    /**
     * 剩余预约人数
     */
    @TableField(exist = false)
    private Integer surplusReserveNumber;
    /**
     * 逻辑删除
     */
    @JsonIgnore
    private Integer deleted;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
